<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>${ title.decode('utf-8') }</title>
    % if debug:
    <script src="http://getfirebug.com/releases/lite/1.2.1/firebug-lite-compressed.js"></script>
    <script type="text/javascript" src="/static/pi.js"></script>
    <script type="text/javascript" src="/static/servers.js"></script>
    <script type="text/javascript" src="/static/chess.js"></script>
    <script type="text/javascript" src="/static/table.js"></script>
    <script type="text/javascript" src="/static/piece.js"></script>
    <script type="text/javascript" src="/static/king.js"></script>
    <script type="text/javascript" src="/static/square.js"></script>
    <script type="text/javascript" src="/static/server.js"></script>
    <script type="text/javascript" src="/static/request.js"></script>
    <script type="text/javascript" src="/static/user.js"></script>
    <script name="debugger">
      pi.util.Init.push(function(){
        window.debug = true;
        window.log = false;
        window.console = {};
        var logger = console.log
        window.console.log = function(){
          if(!log)return;
          logger.apply(window,arguments);
        };
      });
      firebug.env.height = 20; 
      firebug.env.css = "http://localhost/Js/Project/firebug/Source/firebug-lite.css"
    </script>
    % else:
    <script type="text/javascript" src="/static/pi.js"></script>
    <script type="text/javascript" src="/static/compressed.js"></script>
    % endif
    <script type="text/javascript" src="/static/lang/${ lang }.js"></script>
    <script type="text/javascript" src="/user/login"></script>
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
      if(pi.env.ie6){
        document.location.href = '/static/getModernBrowser.html';
      }
      var debug = false;
      pi.util.Init.push(function(){
        main.engine = new Chess();
        main.engine.environment.setLanguage(
          {
          % for l in lang_list:
          "${ l[0] }":"${ l[1] }"\
          %if l[0]!='vi':
,
          % endif
          % endfor
          
          }
        );
        main.engine.environment.setDefaultLanguage('${ lang }');
        main.engine.environment.setUser(
          user
        );
        main.engine.environment.getUser().environment.setLocation( (window.google&&google.loader.ClientLocation&&google.loader.ClientLocation.address.country)||"USA");
        main.engine.createMainScreen();
        main.engine.environment.setActiveServer(main.engine.environment.getServer()[0]);
        % if tableId:
        main.engine.join();
        % endif
      });
    </script>
    <link rel="stylesheet" href="/static/form.css" />
  </head>
  <body>
  
  <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-6866764-1");
  pageTracker._trackPageview();
  } catch(err) {}
  </script>
  </body>
</html>
